<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>人员管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="./plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
        
    <link rel="stylesheet" type="text/css" href="css/myIndex.css">
</head>

<body>
    <div class="conPadding">
        <blockquote class="layui-elem-quote layui-text cly-text">
            为了您的账户安全，请修改密码！
        </blockquote>
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">原密码</label>
                <div class="layui-input-inline">
                    <input type="hidden" name="loginName" value="${loginName}" >
                    <input type="password" name="pass" lay-verify="pass|required"  placeholder="请输入密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">新密码</label>
                <div class="layui-input-inline">
                    <input type="password" name="passNew" lay-verify="passNew|required" placeholder="请输入新密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码</label>
                <div class="layui-input-inline">
                    <input type="password" name="passNew1" lay-verify="passNew1|required" placeholder="请确认密码" autocomplete="off" class="layui-input">
                </div>
            </div>
            
            <div class="layui-form-item buttonCenter">
                <button class="layui-btn" lay-submit="" lay-filter="tijiao">提交</button>
                <button class="layui-btn layui-btn-primary" id="closeButton">关闭</button>
            </div>
        </form>  
    </div>
    <script src="./plugins/layui/layui.js"></script>
    <script type="text/javascript">
        layui.use(['jquery','form'], function($,form){
            form.verify({
                pass: function(value){
                  if(value.length < 6)
                  {
                    return '原密码不能少于6位';
                  }
                },
                passNew: function(value){
                  if(value.length < 6)
                  {
                    return '新密码不能少于6位';
                  }
                },
                passNew1: function(value){
                  var passNew = $('input[name=passNew]').val();
                  if(value != passNew){
                      return '两次输入的密码不一致!';
                  }
                  if(value.length < 6)
                  {
                    return '新密码不能少于6位';
                  }
                }
            }); 
        
           //监听提交
           form.on('submit(tijiao)', function(data){
          //    $.dpAjax({
          //           url:'${basePath}/UserController/diepuUserUpPass',
          //           data:data.field,
          //           success: function(datas)
          //           {
          //               $.layer({datas:datas,layer:true});
          //               if(datas.flag == 100100)
          //               {
          //                 layer.msg(datas.message, {icon: 1});
          //                 setTimeout(function () {
          //                    window.location.href = "${basePath}/web/login.jsp";
          //                 }, 1000);
          //                 return;
          //               }
          //               layer.msg(datas.message, {icon: 2});
          //           }
          //       });
          //      return false;
            });  

           $("#closeButton").click(function(event) {
                window.parent.location.reload();
                var index=parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
           });

        })
    </script>
</body>
</html>